import request from "@/utils/service.js";
export let weixiu = () => {
    return request({
        url: "/repair/getRepairList",
        method: "GET"
    })
}
export let nowei = () => {
    return request({
        url: "/repair/getRepairList",
        method: "GET"
    })
}
export let worker = () => {
    return request({
        url: "/user/getUserList",
        method: "GET"
    })
}
// 添加未维修信息
export let addnowei = (createTime,houseId,ownPhone,repairMsg,repairStatus,) => {
    return request({
        url: "/repair/saveRepair",
        method: "POST",
        data: {
            createTime,
            houseId,
            ownPhone,
            repairMsg,
            repairStatus,
        }
    })
}
// 添加已维修信息
export let addweixiu = (id,createTime,houseId,ownPhone,repairMsg,repairStatus) => {
    return request({
        url: "/repair/saveRepair",
        method: "POST",
        data: {
            id,
            createTime,
            houseId,
            ownPhone,
            repairMsg,
            repairStatus,
        }
    })
}
// 删除未维修信息
export let finshnowei = (id) => {
    return request({
        url: "/repair/deleteRepair/" + id,
        method: "DELETE",
        data: {
            id
        }
    })
}
// 删除已维修信息
export let finshweixiu = (id) => {
    return request({
        url: "/repair/deleteRepair/" + id,
        method: "DELETE",
        data: {
            id
        }
    })
}
//查询搜索已维修单个
export let find = (repairMsg) => {
    return request({
        url: "/repair/likeRepairMsg",
        method: "GET",
        params:{
            repairMsg
        }
    })
}
// 修改未维修信息
export let edit = (createTime,houseId,id,ownPhone,repairMsg,repairStatus) => {
    return request({
        url: "/repair/updateRepair",
        method: "PUT",
        data:{
            createTime,
            houseId,
            id,
            ownPhone,
            repairMsg,
            repairStatus
        }
    })
}
// 修改员工信息
export let editperson = (id,roleId,workName,sex,createTime,birthday,workPhone,idCard) => {
    return request({
        url: "/user/updateUser",
        method: "PUT",
        data:{
            id,
        roleId,
        workName,
        sex,
        createTime,
        birthday,
        workPhone,
        idCard
        }
    })
}
// 添加员工信息
export let addperson = (roleId,workName,sex,createTime,birthday,workPhone,idCard) => {
    return request({
        url: "/user/addUser",
        method: "POST",
        data:{
            roleId,
            workName,
            sex,
            createTime,
            birthday,
            workPhone,
            idCard
        }
    })
}
// 查询所有职位
export let lookrole = () => {
    return request({
        url: "/role/getRoleList ",
        method: "GET",
       
    })
}
// 删除员工信息
export let delperson = (id) => {
    return request({
        url: "/user/deleteUser/"+id,
        method: "DELETE",
        data:{
            id,
        }
    })
}

//获取已分配的房屋
export let getHouse = () => {
    return request({
        url: "/house/getHouseByTrueStatus",
        method: "GET"
    })
}